﻿@using System.Web.Optimization
@inherits VocaDb.Web.Code.VocaDbPage<VocaDb.Web.Models.User.Index>

@{
	PageProperties.Title = ViewRes.SharedStrings.Users;
}

@{ Html.RenderPartial("Partials/_ListUsers"); }

@section BodyScripts {
    
	@Scripts.Render("~/bundles/User/Index")

	<script type="text/javascript">
		$(function () {

			var cultureCode = '@Culture';
			var uiCultureCode = '@UICulture';
			moment.locale(cultureCode);

			var model = @ToJS(Model);
			var filter = model.filter;
			var groupId = model.groupId;
			var urlMapper = new vdb.UrlMapper('@RootPath');
			var repoFactory = new vdb.repositories.RepositoryFactory(urlMapper);
			var repo = repoFactory.userRepository();
			var resourceRepo = repoFactory.resourceRepository();
			var viewModel = new vdb.viewModels.user.ListUsersViewModel(repo, resourceRepo, uiCultureCode, filter, groupId);
			ko.applyBindings(viewModel);

		});
	</script>

}